package com.grj.spring.service;

import com.grj.spring.annotation.Component;
import com.grj.spring.config.BeanPostProcessor;

/**
 * @author 14505
 */
@Component
public class MyBeanPostProcessor implements BeanPostProcessor {
    @Override
    public void postProcessBeforeInitialization(String beanName, Object bean) {
        if(beanName.equals("userService")){
            System.out.println("userService 初始化之前执行了");
        }
    }

    @Override
    public void postProcessAfterInitialization(String beanName, Object bean) {
        if(beanName.equals("userService")){
            System.out.println("userService 初始化之后执行了");
        }
    }
}
